<template>
    <div>
        <h1>获取所有的专业</h1>
        <ul>
            <li v-for="item in all" :key="item._id">{{item.name}}</li>
        </ul>
    </div>
</template>

<script>
export default {
    data(){
        return{
            all:[]
        }
    },
    methods:{
        async getAllSubjects(){
            const {data:{data:{rows}}}=await this.$api.subjects.getSubjects()
            this.all=rows
        }
    },
    created(){
        this.getAllSubjects()
    }
}
</script>

<style>

</style>